package org.csmzxy.class2333;
class pet{    //设置属性
    public String type;
    public int age;
    public boolean vaccinum;

    public String getType(){ //设置方法
        return type;
    }
    public void setType(String type){
        this.type = type;
    }


    public int getAge(){
        return age;
    }
    public void setAge(int age){
        if(age <= 0){
            System.out.println("您输入的年龄错误");
        }
        else{
        this.age = age;
        }
    }


    public boolean gethealth(){
        return vaccinum;
    }
    public void setVaccinum(boolean vaccinum){
        this.vaccinum = vaccinum;
    }
    public void read(){
        System.out.println("这是一只"+type+"品种的狗，他今年"+age+"岁了。"+"\n"+"是否接受了疫苗接种："+vaccinum);
    }
}


public class practise3 {
    public static void main(String[] args){
        pet pet1 = new pet();
        pet1.setType("拉布拉多");
        pet1.setAge(10);
        pet1.setVaccinum(false);
        pet1.read();
    }
}
